package AgentsDB;



import java.io.Serializable;
import java.util.Date;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;



@PersistenceCapable
public class Agent implements Comparable<Agent>, Serializable {
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@PrimaryKey
    @Persistent
    private Long phoneNumber;
	
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Long key;

    @Persistent
    private String agentName;
    
    @Persistent
    private String url;
 
    @Persistent
    private String content;

    @Persistent
    private Date date;

    public Agent(String agentName, Long phoneNumber) {
        this.agentName = agentName;
        this.phoneNumber = phoneNumber;
    }
    public Agent(Long phoneNumber, String agentName,Date date, String url) {
        this.agentName = agentName;
        this.phoneNumber = phoneNumber;
        this.date = date;
        this.url = url;
    }
    
    public Agent(String agentName,Long phoneNumber, String content,Date date) {
        this.agentName = agentName;
        this.content = content;
        this.phoneNumber = phoneNumber;
        this.date = date;
    }
    public Agent(String agentName,Long phoneNumber, String content,Date date,String url) {
        this.agentName = agentName;
        this.content = content;
        this.phoneNumber = phoneNumber;
        this.date = date;
        this.url = url;
    }

    public Long getKey() {
        return key;
    }

    public String getContent() {
        return content;
    }

    public Date getDate() {
        return date;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public void setDate(Date date) {
        this.date = date;
    }

	public void setAgentName(String agentName) {
		this.agentName = agentName;
	}

	public String getAgentName() {
		return agentName;
	}

	public void setPhoneNumber(Long phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public Long getPhoneNumber() {
		return phoneNumber;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getUrl() {
		return url;
	}
	public int compareTo(Agent d) {
		return url.compareTo(d.getUrl());
	}
	public boolean equals(Object o) {
		Agent h = (Agent) o; 
		if (h.getPhoneNumber().equals(this.getPhoneNumber())) {
		return true;
		} else {
		return false;
		}
	}
	public int hashCode() { return 1111; }
}